package com.masterclient.app.modules.goods.adapter;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import com.masterclient.app.R;
import com.eoner.baselibrary.bean.goods.GoodDetailBean;

import java.util.List;

/**
 * 作者：sean
 * 创建时间：2017/6/30 16:05
 * 功能说明：
 */

public class CuXiaoAdapter extends BaseAdapter{
    private List<GoodDetailBean.DataBean.SalesruleGiveBean> list;
    private Context context;
    public CuXiaoAdapter(Context context,List<GoodDetailBean.DataBean.SalesruleGiveBean> list) {
        this.context = context;
        this.list = list;
    }

    @Override
    public int getCount() {
        return list == null?0:list.size();
    }

    @Override
    public Object getItem(int position) {
        return null;
    }

    @Override
    public long getItemId(int position) {
        return 0;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {

        View view = View.inflate(context, R.layout.item_cuxiao,null);
        TextView tv = (TextView) view.findViewById(R.id.tv_title);
        TextView tv_time = (TextView) view.findViewById(R.id.tv_time);
        GoodDetailBean.DataBean.SalesruleGiveBean bean = list.get(position);
        tv.setText(bean.getSh_title());
        tv_time.setText(bean.getSh_start_at()+"~"+bean.getSh_end_at());
        return view;
    }
}
